<form class="form-horizontal" name="host_form" ng-submit="do_clone()">
    <div class="modal-header">
        <a class="close" ng-click="close()">×</a>

        <h5>{{ title }}</h5>
    </div>
    <div class="modal-body">
        <div class="row-fluid">
            <div class="control-group">
                <label class="control-label">源虚拟机名称：</label>

                <div class="controls">
                    <label class="fieldinline">{{ vm.name }}</label>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">目标虚拟机：</label>

                <div class="controls">
                    <input type="text" required ng-model="newvm.name" ng-pattern="/^\w+$/"/>
                </div>
            </div>
            <!--<div class="control-group">
                <label class="control-label">完全克隆：</label>

                <div class="controls">
                    <input type="checkbox" ng-model="newvm.fullclone"/>

                    <i class="icon-info-sign"/>完全克隆将会连快照一起复制
                </div>
            </div>-->
            <div class="control-group">
                <label class="control-label">目标主机：</label>

                <div class="controls">
                    <select ng-options="n.host_name for n in hosts" ng-model="newvm.host" required>
                    </select>
                </div>
            </div>
            <hr>
            <label for="">磁盘</label>
            <div class="control-group">
                <label class="control-label">保留光驱：</label>

                <div class="controls">
                    <input type="checkbox" ng-model="newvm.samecdrom"/>
                </div>
            </div>
            <div class="control-group" ng-repeat="disk in vm.vdisk_set |filter:{device_type:'disk'}">
                <label class="control-label">{{ disk.name }}存储：</label>

                <div class="controls">
                    <select ng-options="n.name for n in storages" ng-model="newvm.storage[disk.name+disk.id]" required>
                    </select>
                </div>
            </div>

            <hr>
            <label for="">网络</label>
            <div class="control-group" ng-repeat="iface in vm.interface_set|filter:{enable:true}">
                <label class="control-label">{{ iface.name }}网络：</label>

                <div class="controls">
                    <select ng-options="n.name for n in networks" ng-model="newvm.network[iface.name+iface.id]" required>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <a data-dismiss="modal" class="btn" ng-click="close()">关闭</a>
        <button type="submit" ng-disabled="!host_form.$valid" class="btn btn-primary">保存</button>
    </div>
</form>